package com.example.C317DataSource.controller;

import com.example.C317DataSource.model.MongoTest;
import com.example.C317DataSource.service.IMongoTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * MongoTestC
 *
 * @author wnm
 * @date 2020/12/29
 */
@RestController
public class MongoTestC {

    @Autowired
    private IMongoTestService iMongoTestService;

    @GetMapping(value="/test1")
    public void saveTest() throws Exception {
        iMongoTestService.saveTest();
    }

    @GetMapping(value="/test2")
    public MongoTest findTestByName(){
        return iMongoTestService.findTestByName();
    }

    @GetMapping(value="/test3")
    public void updateTest(){
        iMongoTestService.updateTest();
    }

    @GetMapping(value="/test4")
    public void deleteTestById(){
        iMongoTestService.deleteTestById();
    }
}
